package com.galaxis.wms.query

import com.galaxis.wms.entity.BasResource
import com.querydsl.core.types.Path
import com.querydsl.core.types.PathMetadata
import com.querydsl.core.types.dsl.DateTimePath
import com.querydsl.core.types.dsl.NumberPath
import com.querydsl.core.types.dsl.StringPath
import com.querydsl.sql.ColumnMetadata
import com.querydsl.sql.RelationalPathBase

import java.sql.Timestamp
import java.sql.Types

import static com.querydsl.core.types.PathMetadataFactory.forVariable

/**
 * 资源(bas_resource)
 */
@SuppressWarnings("ALL")
class QBasResource extends RelationalPathBase<BasResource> {
    /** bas_resource表 */
    public static final QBasResource basResource = new QBasResource("bas_resource")

    /** 资源ID */
    public final NumberPath<Long> resourceId = createNumber("resourceId", Long.class)
    /** 父资源 */
    public final NumberPath<Long> resourceParent = createNumber("resourceParent", Long.class)
    /** 资源类型 */
    public final StringPath resourceType = createString("resourceType")
    /** 菜单名称 */
    public final StringPath menuName = createString("menuName")
    /** 菜单url */
    public final StringPath menuUrl = createString("menuUrl")
    /** 菜单图标 */
    public final StringPath menuIcon = createString("menuIcon")
    /** 权限编码 */
    public final StringPath permissionCode = createString("permissionCode")
    /** 组件名称 */
    public final StringPath componentName = createString("componentName")
    /** 顺序号 */
    public final NumberPath<Integer> sort = createNumber("sort", Integer.class)
    /** 是否启用 */
    public final StringPath isEnable = createString("isEnable")
    /** 创建者 */
    public final StringPath createBy = createString("createBy")
    /** 建立时间 */
    public final DateTimePath<Timestamp> createAt = createDateTime("createAt", Timestamp.class)
    /** 修改者 */
    public final StringPath updateBy = createString("updateBy")
    /** 更新时间 */
    public final DateTimePath<Timestamp> updateAt = createDateTime("updateAt", Timestamp.class)

    QBasResource(String variable) {
        super(BasResource.class, forVariable(variable), "public", "bas_resource")
        addMetadata()
    }

    QBasResource(String variable, String schema, String table) {
        super(BasResource.class, forVariable(variable), schema, table)
        addMetadata()
    }

    QBasResource(String variable, String schema) {
        super(BasResource.class, forVariable(variable), schema, "bas_resource")
        addMetadata()
    }

    QBasResource(Path<? extends BasResource> path) {
        super(path.getType(), path.getMetadata(), "public", "bas_resource")
        addMetadata()
    }

    QBasResource(PathMetadata metadata) {
        super(BasResource.class, metadata, "public", "bas_resource")
        addMetadata()
    }

    void addMetadata() {
        addMetadata(resourceId, ColumnMetadata.named("resource_id").withIndex(1).ofType(Types.BIGINT).withSize(64))
        addMetadata(resourceParent, ColumnMetadata.named("resource_parent").withIndex(2).ofType(Types.BIGINT).withSize(64))
        addMetadata(resourceType, ColumnMetadata.named("resource_type").withIndex(3).ofType(Types.VARCHAR).withSize(50))
        addMetadata(menuName, ColumnMetadata.named("menu_name").withIndex(4).ofType(Types.VARCHAR).withSize(255))
        addMetadata(menuUrl, ColumnMetadata.named("menu_url").withIndex(5).ofType(Types.VARCHAR).withSize(255))
        addMetadata(menuIcon, ColumnMetadata.named("menu_icon").withIndex(6).ofType(Types.VARCHAR).withSize(255))
        addMetadata(permissionCode, ColumnMetadata.named("permission_code").withIndex(7).ofType(Types.VARCHAR).withSize(255))
        addMetadata(componentName, ColumnMetadata.named("component_name").withIndex(8).ofType(Types.VARCHAR).withSize(255))
        addMetadata(sort, ColumnMetadata.named("sort").withIndex(9).ofType(Types.INTEGER).withSize(32))
        addMetadata(isEnable, ColumnMetadata.named("is_enable").withIndex(10).ofType(Types.VARCHAR).withSize(50))
        addMetadata(createBy, ColumnMetadata.named("create_by").withIndex(11).ofType(Types.VARCHAR).withSize(64))
        addMetadata(createAt, ColumnMetadata.named("create_at").withIndex(12).ofType(Types.TIMESTAMP).withSize(100))
        addMetadata(updateBy, ColumnMetadata.named("update_by").withIndex(13).ofType(Types.VARCHAR).withSize(64))
        addMetadata(updateAt, ColumnMetadata.named("update_at").withIndex(14).ofType(Types.TIMESTAMP).withSize(100))
    }
}
